package com.wechat.back.service.impl;

import com.wechat.back.mapper.IconsMapper;
import com.wechat.back.pojo.pic.Icons;
import com.wechat.back.service.IconsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class IconsServiceImpl implements IconsService {
    @Autowired private IconsMapper iconsMapper;
    @Override
    public List<Icons> list(Integer iconId,String iconType) {
        return iconsMapper.list(iconId, iconType);
    }

    @Override
    public void add(Icons icons) {
        //补充属性值
        icons.setCreateTime(LocalDateTime.now());
        icons.setUpdateTime(LocalDateTime.now());
        iconsMapper.add(icons);
    }

    @Override
    public void update(Icons icons) {
        icons.setUpdateTime(LocalDateTime.now());
        iconsMapper.update(icons);
    }

    @Override
    public void delete(Integer iconId) {
        iconsMapper.delete(iconId);
    }
}
